import request from '@/utils/request'

export abstract class LoginRequest {
  /** 获取图片验证码 */
  static getCaptcha(): Promise<{ uuid: string; captcha: string }> {
    return request.get('/captcha')
  }

  /** 登录 */
  static login(data: UserType.LoginParams): Promise<UserType.LoginResult> {
    return request.post('/login', data)
  }

  /** 获取登录账号的信息 */
  static getInfo(): Promise<UserType.Info> {
    return request.get('/getInfo')
  }

  /** 获取登录账号的路由表信息 */
  static getRoutes(): Promise<MenuType.Entity[]> {
    return request.get('/getRoutes')
  }

  /** 登出 */
  static logout() {
    return request.post('/logout')
  }
}
